﻿#ifndef PST_DIALOGSHIELDINGEFFICIENCY_H
#define PST_DIALOGSHIELDINGEFFICIENCY_H

#include <IdaDialogFrame>
#include <QModelIndexList>
#include <QStringListModel>
QT_BEGIN_NAMESPACE
namespace Ui
{
    class DialogShieldingEfficiency;
};
QT_END_NAMESPACE

namespace pst
{
    class DataChosenListDialog;
    class DialogShieldingEfficiency : public IdaDialogFrame
    {
        Q_OBJECT

    public:
        DialogShieldingEfficiency(QWidget* parent = nullptr);
        ~DialogShieldingEfficiency();
        void setCurveNameList(const QList<QString>& curveNameList);
        void setInit(QStringList& params);

    public slots:
        void on_pushButton_confirm_clicked();
        void on_pushButton_cancel_clicked();
        void slot_sentChosenDataIds(const QModelIndexList& chosenID);

        /// @brief 电场总量曲线单选按钮点击
        /// @param checked
        void on_radioButton_TotalElectricField_toggled(bool checked);
        /// @brief 复数形式电场分量曲线单选按钮点击
        /// @param checked
        void on_radioButton_PluralForm_toggled(bool checked);
        /// @brief 幅度形式电场分量曲线单选按钮点击
        /// @param checked
        void on_radioButton_AmplitudeForm_toggled(bool checked);

        /// @brief 电场总量曲线选择按钮点击
        void on_pushButton_TotalElectricField_clicked();
        /// @brief 复数形式电场分量曲线按钮点击
        void on_pushButton_PluralForm_clicked();
        /// @brief 幅度形式电场分量曲线按钮点击
        void on_pushButton_AmplitudeForm_clicked();

    private:
        void openDataChosenListDialog(bool isMultiSelect); // 打开数据选择框进行数据选择
        QModelIndexList createSelectedIndexes(const QStringList& params);

    signals:
        void signal_computeEffectiveness(const QString& graphNames, double e0);

    private:
        Ui::DialogShieldingEfficiency* ui;
        DataChosenListDialog* m_dataChosenListDialog;
        QList<QString> m_curveNameList;
        QList<int> m_selectedIndexsTotalElectricField;
        QList<int> m_selectedIndexsPluralForm;
        QList<int> m_selectedIndexsAmplitudeForm;

        bool m_isTotalElectricFieldPushButtonClicked = false;
        bool m_isPluralFormPushButtonClicked = false;
        bool m_isAmplitudeFormPushButtonClicked = false;

        QStringListModel m_model;
    };
} // namespace pst

#endif
